import { IDragDrop } from "../../../../../com/mui/manager/IDragDrop";
import { BaseItem } from "../../common/BaseItem";
import { EPlayerItemPosType } from "../../../../../Message/Public/EPlayerItemPosType";
import { ECategory } from "../../../../../Message/Public/ECategory";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../events/DataEvent";
import { EventName } from "../../../mvc/EventName";
import { Cache } from "../../../cache/Cache";
import { ShopOperType } from "../../shop/ShopOperType";
import { EquipmentUtil } from "../../common/util/EquipmentUtil";
import { GModuleEvent } from "../../../mvc/GModuleEvent";
import { ToolTipInfo } from "../../../model/ToolTipInfo";
import { Tooltip } from "../../common/tooltip/Tooltip";
import { DragEvent } from "../../../../../com/mui/events/DragEvent";
import { EDressPos } from "../../../../../Message/Public/EDressPos";
import { EEquip } from "../../../../../Message/Public/EEquip";
import { ObjCreate } from "../../common/ObjCreate";
import { Language } from "../../../../../extend/language/Language";
import { GlobalSkin } from "../../../../component/skin/GlobalSkin";
import { GSprite } from "../../../../../com/mui/controls/GSprite";
import { PlayerEquipItem } from "../../common/PlayerEquipItem";
import { ItemData } from "../../../resource/info/ItemData";
import { ResFileConst } from "../../../resource/ResFileConst";
import { EquipmentStrengthAddPanel } from "./EquipmentStrengthAddPanel";
import { EquipmentJewelAddPanel } from "./EquipmentJewelAddPanel";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { EquipmentToolTipData } from "../../../resource/info/EquipmentToolTipData";
import { WardrobeType } from "../../wardrobe/WardrobeType";
import { GLoadedButton } from "../../../../../com/mui/controls/GLoadedButton";
import { GButton } from "../../../../../com/mui/controls/GButton";
import { _EEquipHelmet } from "../../../../../EEquip/_EEquipHelmet";
import { _EDressPosHelmet } from "../../../../../EDressPos/_EDressPosHelmet";
import { _EEquipShoulder } from "../../../../../EEquip/_EEquipShoulder";
import { _EDressPosShoulder } from "../../../../../EDressPos/_EDressPosShoulder";
import { _EEquipClothes } from "../../../../../EEquip/_EEquipClothes";
import { _EDressPosClothes } from "../../../../../EDressPos/_EDressPosClothes";
import { _EEquipBelt } from "../../../../../EEquip/_EEquipBelt";
import { _EDressPosBelt } from "../../../../../EDressPos/_EDressPosBelt";
import { _EEquipPants } from "../../../../../EEquip/_EEquipPants";
import { _EDressPosPants } from "../../../../../EDressPos/_EDressPosPants";
import { _EEquipShoes } from "../../../../../EEquip/_EEquipShoes";
import { _EDressPosShoes } from "../../../../../EDressPos/_EDressPosShoes";
import { _EEquipWeapon } from "../../../../../EEquip/_EEquipWeapon";
import { _EDressPosWeapon } from "../../../../../EDressPos/_EDressPosWeapon";
import { _EEquipJewelry } from "../../../../../EEquip/_EEquipJewelry";
import { _EDressPosJewelry1 } from "../../../../../EDressPos/_EDressPosJewelry1";
import { _EDressPosJewelry2 } from "../../../../../EDressPos/_EDressPosJewelry2";
import { _EEquipWristlet } from "../../../../../EEquip/_EEquipWristlet";
import { _EDressPosWristlet } from "../../../../../EDressPos/_EDressPosWristlet";
import { _EEquipGloves } from "../../../../../EEquip/_EEquipGloves";
import { _EDressPosGloves } from "../../../../../EDressPos/_EDressPosGloves";
import { _EEquipRing } from "../../../../../EEquip/_EEquipRing";
import { _EDressPosRing1 } from "../../../../../EDressPos/_EDressPosRing1";
import { _EDressPosRing2 } from "../../../../../EDressPos/_EDressPosRing2";
import { _EDressPosMount } from "../../../../../EDressPos/_EDressPosMount";
import { _EEquipHarmMedalDeeper } from "../../../../../EEquip/_EEquipHarmMedalDeeper";
import { _EDressPosHarmMedalDeeper } from "../../../../../EDressPos/_EDressPosHarmMedalDeeper";
import { _EEquipHarmMedalLower } from "../../../../../EEquip/_EEquipHarmMedalLower";
import { _EDressPosHarmMedalLower } from "../../../../../EDressPos/_EDressPosHarmMedalLower";
import { _EEquipHeartLock } from "../../../../../EEquip/_EEquipHeartLock";
import { _EDressPosHeartLock } from "../../../../../EDressPos/_EDressPosHeartLock";
import { _EEquipWing } from "../../../../../EEquip/_EEquipWing";
import { _EDressPosWing } from "../../../../../EDressPos/_EDressPosWing";
import { _EEquipFashion } from "../../../../../EEquip/_EEquipFashion";
import { _EDressPosFashion } from "../../../../../EDressPos/_EDressPosFashion";
import { _EEquipFashionWeapon } from "../../../../../EEquip/_EEquipFashionWeapon";
import { _EDressPosFashionWeapon } from "../../../../../EDressPos/_EDressPosFashionWeapon";
import { _EEquipSurround } from "../../../../../EEquip/_EEquipSurround";
import { _EDressPosSurround } from "../../../../../EDressPos/_EDressPosSurround";
import { _EEquipWaistBelt } from "../../../../../EEquip/_EEquipWaistBelt";
import { _EDressPosWaistBelt } from "../../../../../EDressPos/_EDressPosWaistBelt";
import { _EEquipElf } from "../../../../../EEquip/_EEquipElf";
import { _EDressPosElf } from "../../../../../EDressPos/_EDressPosElf";
import { _EEquipFootPrint } from "../../../../../EEquip/_EEquipFootPrint";
import { _EDressPosFootPrint } from "../../../../../EDressPos/_EDressPosFootPrint";
import { _EEquipBubble } from "../../../../../EEquip/_EEquipBubble";
import { _EDressPosBubble } from "../../../../../EDressPos/_EDressPosBubble";
type int = number;
//class EquipsPanel
    
    export  class EquipsPanel /* flash.display.Sprite */
    {
        constructor()
        {
            
            this._allEquipmentsOnPlayer = [];
            this._equipItemTypeFirstArr = [];
            this._equipItemTypeSecArr = [];
            this._equipItemFirstArr = [];
            this._equipItemSecArr = [];
            this._lookUpFashionJewelInfoArr = [];
            this.initEquipItemTypeArr();
            this.initUI();
            return;
        }

        public canDrop(arg1: IDragDrop, arg2: IDragDrop): Boolean
        {
            var loc1=arg1 as BaseItem;
            if (loc1.posType == EPlayerItemPosType._EPlayerItemPosTypeRole) 
            {
                return false;
            }
            if (loc1) 
            {
                if (loc1.itemData.itemInfo.item.category == ECategory._ECategoryEquip || loc1.itemData.itemInfo.item.category == ECategory._ECategoryMount) 
                {
                    return true;
                }
                return false;
            }
            return false;
        }

        /* internal  */onItemDoubleClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=arg1.currentTarget as BaseItem;
            if (loc1.name == "mountItem" && loc1.itemData) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.MountsUnEquipReq, loc1.itemData));
            }
            else if (loc1.itemData && !(Cache.instance.shop.operType == ShopOperType.FIX)) 
            {
                EquipmentUtil.suitAttrUnlockAlert(loc1.itemData, false, this.unDressReq, loc1);
            }
            return;
        }

        /* internal  */unDressReq(arg1: Object): void
        {
            var loc1=arg1 as BaseItem;
            this.unDress(loc1.itemData.uid, loc1.posIndex);
            return;
        }

        public unDress(arg1: string, arg2: int): void
        {
            this.dispatchEvent(new DataEvent(GModuleEvent.Event_unDress, {"uid": arg1, "index": arg2}, false, true));
            return;
        }

        public set flyLv(arg1: int)
        {
            this._flyLv = arg1;
            return;
        }

        public set curLv(arg1: int)
        {
            this._curLv = arg1;
            return;
        }

        public set curCareer(arg1: int)
        {
            this._curCareer = arg1;
            this._strengthAddPanel.curCareer = arg1;
            this._jewelAddPanel.curCareer = arg1;
            return;
        }

        /* internal  */onItemClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=arg1.currentTarget as BaseItem;
            if (loc1.itemData && Cache.instance.shop.operType == ShopOperType.FIX) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.ShopFixEquipment, {"posType": loc1.itemData.posType, "itemData": loc1.itemData}));
            }
            return;
        }

        /* internal  */onItemDown(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=null;
            var loc2=null;
            if (arg1.ctrlKey) 
            {
                loc1 = arg1.target as BaseItem;
                if (loc1 && loc1.itemData) 
                {
                    loc2 = Cache.instance.pack.rolePackCache.getItemDataByUid(loc1.itemData.uid);
                    if (loc2) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.ChatShowItem, loc2));
                    }
                }
            }
            return;
        }

        /* internal  */getToolTipMountData(arg1: BaseItem): ToolTipInfo
        {
            if (arg1.itemData) 
            {
                return new ToolTipInfo(Tooltip.ToolTipRenderType_Mounts, arg1.itemData);
            }
            return null;
        }

        /* internal  */moveInHandler(arg1: DragEvent): void
        {
            var loc3=0;
            var loc4=0;
            var loc5=null;
            var loc6=0;
            var loc7=0;
            var loc1=arg1.dragItem as BaseItem;
            var loc2=arg1.dropItem as BaseItem;
            if (loc1 && !(loc1.posIndex == EPlayerItemPosType._EPlayerItemPosTypeRole)) 
            {
                loc3 = loc1.itemData.itemInfo.item.type;
                loc4 = loc1.itemData.itemInfo.item.category;
                loc5 = "";
                loc6 = -1;
                if (loc2) 
                {
                    if ((loc7 = loc2.posIndex) == EDressPos._EDressPosRing1 || loc7 == EDressPos._EDressPosRing2) 
                    {
                        if (loc4 == ECategory._ECategoryProp && loc3 == EEquip._EEquipRing) 
                        {
                            loc6 = loc7;
                        }
                    }
                    if (loc7 == EDressPos._EDressPosJewelry1 || loc7 == EDressPos._EDressPosJewelry2) 
                    {
                        if (loc4 == ECategory._ECategoryJewel && loc3 == EEquip._EEquipJewelry) 
                        {
                            loc6 = loc7;
                        }
                    }
                }
                this.dispatchEvent(new DataEvent(GModuleEvent.Event_Dress, {"posType": loc1.posType, "uid": loc1.itemData.uid, "index": loc6}, false, true));
            }
            return;
        }

        public setOtherEquipments(): void
        {
            this._strengthAddPanel.setOtherEquips();
            this._jewelAddPanel.setOtherEquips();
            return;
        }

        public updateAddInfos(): void
        {
            this._strengthAddPanel.updateAddInfo();
            this._jewelAddPanel.updateAddInfo();
            return;
        }

        public setAddPanelVisible(arg1: Boolean): void
        {
            this._strengthAddPanel.visible = arg1;
            this._jewelAddPanel.visible = arg1;
            return;
        }

        public changeNormalBtn(): void
        {
            this._pageBtn.visible = false;
            this._pageNormalBtn = ObjCreate.createGButton(Language.getString(30320), 85, 270, 80, 25, this, GlobalSkin.ButtonRed);
            this._pageNormalBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onPageNormalBtnClickHandler);
            return;
        }

        /* internal  */onPageNormalBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (this._curPage != 1) 
            {
                if (this._curPage == 2) 
                {
                    this._firstSp.visible = true;
                    this._secSp.visible = false;
                    this._curPage = 1;
                    this._pageNormalBtn.label = Language.getString(30320);
                }
            }
            else 
            {
                this._firstSp.visible = false;
                this._secSp.visible = true;
                this._curPage = 2;
                this._pageNormalBtn.label = Language.getString(30321);
            }
            this.updateEquipItems();
            return;
        }

        public updateFashionJewelInfo(arg1: Array<any>, arg2: int): void
        {
            this._lookUpFashionJewelInfoArr = arg1;
            this._curLv = arg2;
            return;
        }

        public get mode(): string
        {
            return this._mode;
        }

        /* internal  */getFashionJewelTooltipsData(arg1: string, arg2: BaseItem, arg3: int, arg4: Array<any>): Array<any>
        {
            var loc1=0;
            if (arg2 == null) 
            {
                return [];
            }
            if (arg2.posIndex != EDressPos._EDressPosFashion) 
            {
                if (arg2.posIndex != EDressPos._EDressPosFashionWeapon) 
                {
                    if (arg2.posIndex != EDressPos._EDressPosWing) 
                    {
                        if (arg2.posIndex != EDressPos._EDressPosFootPrint) 
                        {
                            if (arg2.posIndex != EDressPos._EDressPosBubble) 
                            {
                                if (arg2.posIndex != EDressPos._EDressPosSurround) 
                                {
                                    if (arg2.posIndex != EDressPos._EDressPosWaistBelt) 
                                    {
                                        if (arg2.posIndex != EDressPos._EDressPosElf) 
                                        {
                                            return [];
                                        }
                                        else 
                                        {
                                            loc1 = EEquip._EEquipElf;
                                        }
                                    }
                                    else 
                                    {
                                        loc1 = EEquip._EEquipWaistBelt;
                                    }
                                }
                                else 
                                {
                                    loc1 = EEquip._EEquipSurround;
                                }
                            }
                            else 
                            {
                                loc1 = EEquip._EEquipBubble;
                            }
                        }
                        else 
                        {
                            loc1 = EEquip._EEquipFootPrint;
                        }
                    }
                    else 
                    {
                        loc1 = EEquip._EEquipWing;
                    }
                }
                else 
                {
                    loc1 = EEquip._EEquipFashionWeapon;
                }
            }
            else 
            {
                loc1 = EEquip._EEquipFashion;
            }
            var loc2=[];
            if (arg1 != GModuleEvent.Mode_Self) 
            {
                if (this._lookUpFashionJewelInfoArr) 
                {
                    loc2 = Cache.instance.wardrobe.getOtherFashionJewelInfoArr(arg3, loc1, arg4);
                }
            }
            else 
            {
                loc2 = Cache.instance.wardrobe.getSelfFashionJewelInfoArr(arg3, loc1);
            }
            return loc2;
        }

        protected initEquipItemTypeArr(): void
        {
            var loc1=ECategory._ECategoryEquip;
            var loc2=ECategory._ECategoryMount;
            this._equipItemTypeFirstArr = [{"category": loc1, "type": _EEquipHelmet, "posIndex": _EDressPosHelmet}, {"category": loc1, "type": _EEquipShoulder, "posIndex": _EDressPosShoulder}, {"category": loc1, "type": _EEquipClothes, "posIndex": _EDressPosClothes}, {"category": loc1, "type": _EEquipBelt, "posIndex": _EDressPosBelt}, {"category": loc1, "type": _EEquipPants, "posIndex": _EDressPosPants}, {"category": loc1, "type": _EEquipShoes, "posIndex": _EDressPosShoes}, {"category": loc1, "type": _EEquipWeapon, "posIndex": _EDressPosWeapon}, {"category": loc1, "type": _EEquipJewelry, "posIndex": _EDressPosJewelry1}, {"category": loc1, "type": _EEquipJewelry, "posIndex": _EDressPosJewelry2}, {"category": loc1, "type": _EEquipWristlet, "posIndex": _EDressPosWristlet}, {"category": loc1, "type": _EEquipGloves, "posIndex": _EDressPosGloves}, {"category": loc1, "type": _EEquipRing, "posIndex": _EDressPosRing1}, {"category": loc1, "type": _EEquipRing, "posIndex": _EDressPosRing2}, {"category": loc2, "type": 0, "posIndex": _EDressPosMount}, {"category": loc1, "type": _EEquipHarmMedalDeeper, "posIndex": _EDressPosHarmMedalDeeper}, {"category": loc1, "type": _EEquipHarmMedalLower, "posIndex": _EDressPosHarmMedalLower}, {"category": loc1, "type": _EEquipHeartLock, "posIndex": _EDressPosHeartLock}];
            this._equipItemTypeSecArr = [{"category": loc1, "type": _EEquipWing, "posIndex": _EDressPosWing}, {"category": loc1, "type": _EEquipFashion, "posIndex": _EDressPosFashion}, {"category": loc1, "type": _EEquipFashionWeapon, "posIndex": _EDressPosFashionWeapon}, {"category": loc1, "type": _EEquipSurround, "posIndex": _EDressPosSurround}, {"category": loc1, "type": _EEquipWaistBelt, "posIndex": _EDressPosWaistBelt}, {"category": loc1, "type": _EEquipElf, "posIndex": _EDressPosElf}, {"category": loc1, "type": _EEquipFootPrint, "posIndex": _EDressPosFootPrint}, {"category": loc1, "type": _EEquipBubble, "posIndex": _EDressPosBubble}];
            return;
        }

        /* internal  */createEquipItem(arg1: Array<any>, arg2: Array<any>, arg3: int, arg4: int, arg5: int, arg6: GSprite): void
        {
            var loc6=null;
            var loc1=13;
            var loc2=6;
            if (arg5 != 1) 
            {
                if (arg5 == 2) 
                {
                    loc1 = 5;
                    loc2 = 2;
                }
            }
            else 
            {
                loc1 = 13;
                loc2 = 6;
            }
            var loc3=arg3;
            var loc4=arg4;
            var loc5=arg1.length;
            var loc7=Object;
            var loc8=0;
            while (loc8 < loc5) 
            {
                loc7 = arg1[loc8];
                (loc6 = new PlayerEquipItem()).setOverPosition(-2, -2);
                loc6.setSize(33, 33);
                loc6.dropChecktFunction = this.canDrop;
                loc6.isThrowAble = false;
                loc6.doubleClickEnabled = true;
                loc6.toolTipDataFunction = this.getToolTipData;
                loc6.posType = EPlayerItemPosType._EPlayerItemPosTypeRole;
                loc6.posIndex = loc7.posIndex;
                loc6.x = arg3;
                loc6.y = arg4;
                loc6.setEquipmentBg(loc7.category, loc7.type);
                if (loc7.category == ECategory._ECategoryMount) 
                {
                    loc6.toolTipType = ItemData.ToolTipType_Mounts;
                    loc6.toolTipDataFunction = this.getToolTipMountData;
                    loc6.removeEventListener(flash.events.MouseEvent.CLICK, this.onItemClick);
                }
                if (loc8 <= loc1) 
                {
                    arg4 = arg4 + 42;
                }
                if (loc8 > loc1) 
                {
                    arg3 = arg3 + 51;
                }
                if (loc8 != loc2) 
                {
                    if (loc8 == loc1) 
                    {
                        if (arg5 != 1) 
                        {
                            if (arg5 == 2) 
                            {
                                arg3 = 88;
                            }
                        }
                        else 
                        {
                            arg3 = 58;
                        }
                        arg4 = 225;
                    }
                }
                else 
                {
                    arg3 = 211;
                    arg4 = loc4;
                }
                arg6.addChild(loc6);
                arg2.push(loc6);
                ++loc8;
            }
            this.addEventListener(DragEvent.Event_Move_In, this.moveInHandler);
            return;
        }

        protected initUI(): void
        {
            this._firstSp = new GSprite();
            this._firstSp.visible = true;
            addChild(this._firstSp);
            this._secSp = new GSprite();
            this._secSp.visible = false;
            addChild(this._secSp);
            this.createEquipItem(this._equipItemTypeFirstArr, this._equipItemFirstArr, 8, 28, 1, this._firstSp);
            this.createEquipItem(this._equipItemTypeSecArr, this._equipItemSecArr, 8, 108, 2, this._secSp);
            this._pageBtn = ObjCreate.createGLoadedButton(ResFileConst.PlayerFashionBtn, 80, 265, 94, 36, this);
            this._pageBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onPageBtnClickHandler);
            this._strengthAddPanel = new EquipmentStrengthAddPanel();
            this._strengthAddPanel.x = 55;
            this._strengthAddPanel.y = 30;
            addChild(this._strengthAddPanel);
            this._jewelAddPanel = new EquipmentJewelAddPanel();
            this._jewelAddPanel.x = 165;
            this._jewelAddPanel.y = 30;
            addChild(this._jewelAddPanel);
            return;
        }

        /* internal  */onPageBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (this._curPage != 1) 
            {
                if (this._curPage == 2) 
                {
                    this._firstSp.visible = true;
                    this._secSp.visible = false;
                    this._curPage = 1;
                    this._pageBtn.styleName = ResFileConst.PlayerFashionBtn;
                }
            }
            else 
            {
                this._firstSp.visible = false;
                this._secSp.visible = true;
                this._curPage = 2;
                this._pageBtn.styleName = ResFileConst.PlayerEquipBtn;
            }
            this.updateEquipItems();
            return;
        }

        public addFilters(arg1: Boolean): void
        {
            if (arg1) 
            {
                this.filters = [FilterConst.colorFilter2];
            }
            else 
            {
                this.filters = [];
            }
            return;
        }

        public set mode(arg1: string)
        {
            this._mode = arg1;
            this._strengthAddPanel.mode = arg1;
            this._jewelAddPanel.mode = arg1;
            this.updateEquipItemOpt(this._equipItemFirstArr);
            this.updateEquipItemOpt(this._equipItemSecArr);
            return;
        }

        /* internal  */updateEquipItemOpt(arg1: Array<any>): void
        {
            var loc2=null;
            var loc3=0;
            var loc1=arg1.length;
            loc3 = 0;
            while (loc3 < loc1) 
            {
                loc2 = arg1[loc3] as PlayerEquipItem;
                if (loc2) 
                {
                    if (this._mode != GModuleEvent.Mode_Self) 
                    {
                        loc2.isDragAble = false;
                    }
                    else 
                    {
                        loc2.isDragAble = true;
                        loc2.addEventListener(flash.events.MouseEvent.DOUBLE_CLICK, this.onItemDoubleClick);
                        loc2.addEventListener(flash.events.MouseEvent.CLICK, this.onItemClick);
                        loc2.addEventListener(flash.events.MouseEvent.MOUSE_DOWN, this.onItemDown);
                    }
                    if (loc2.category == ECategory._ECategoryMount) 
                    {
                        loc2.removeEventListener(flash.events.MouseEvent.CLICK, this.onItemClick);
                    }
                }
                ++loc3;
            }
            return;
        }

        public setEquipments(arg1: Array<any>): void
        {
            this._allEquipmentsOnPlayer = arg1;
            this.updateEquipItems();
            return;
        }

        /* internal  */updateEquipItems(): void
        {
            var loc1=null;
            var loc4=null;
            var loc5=null;
            var loc6=0;
            var loc7=0;
            if (this._curPage != 1) 
            {
                if (this._curPage == 2) 
                {
                    loc1 = this._equipItemSecArr;
                }
            }
            else 
            {
                loc1 = this._equipItemFirstArr;
            }
            var loc2=this._allEquipmentsOnPlayer.length;
            var loc3=loc1.length;
            loc6 = 0;
            while (loc6 < loc3) 
            {
                if (loc5 = loc1[loc6] as PlayerEquipItem) 
                {
                    loc5.itemData = null;
                }
                ++loc6;
            }
            loc6 = 0;
            while (loc6 < loc2) 
            {
                loc4 = this._allEquipmentsOnPlayer[loc6];
                loc7 = 0;
                while (loc7 < loc3) 
                {
                    loc5 = loc1[loc7] as PlayerEquipItem;
                    if (loc4 && loc5 && loc4.category == loc5.category && loc4.type == loc5.type && loc6 + 1 == loc5.posIndex) 
                    {
                        loc5.itemData = loc4;
                    }
                    ++loc7;
                }
                ++loc6;
            }
            return;
        }

        public updateAnItem(arg1: int, arg2: ItemData): void
        {
            var loc1=null;
            var loc3=null;
            if (this._curPage != 1) 
            {
                if (this._curPage == 2) 
                {
                    loc1 = this._equipItemTypeSecArr;
                }
            }
            else 
            {
                loc1 = this._equipItemFirstArr;
            }
            var loc2=loc1.length;
            var loc4=0;
            while (loc4 < loc2) 
            {
                loc3 = loc1[loc4] as PlayerEquipItem;
                if (arg2 && loc3 && arg2.category == loc3.category && arg2.type == loc3.type && arg1 == loc3.posIndex) 
                {
                    loc3.itemData = arg2;
                }
                ++loc4;
            }
            return;
        }

        /* internal  */getToolTipData(arg1: PlayerEquipItem): ToolTipInfo
        {
            var loc1=null;
            var loc2=null;
            if (arg1.itemData) 
            {
                if (this._mode == GModuleEvent.Mode_Self) 
                {
                    loc2 = Cache.instance.pack.rolePackCache.getAllItemsEnabledCareer();
                    loc1 = new EquipmentToolTipData(arg1.itemData, loc2);
                    loc1.baseAttrExtraArray = this.setToolData(arg1);
                    loc1.fashionJewelInfoArr = this.getFashionJewelTooltipsData(GModuleEvent.Mode_Self, arg1, this._curCareer, []);
                    loc1.roleLv = Cache.instance.role.entityInfo.level;
                    loc1.flyLv = Cache.instance.wardrobe.flyWingInfo.flyLevel;
                    return new ToolTipInfo(Tooltip.ToolTipRenderType_Equipment, loc1);
                }
                loc1 = new EquipmentToolTipData(arg1.itemData, this._allEquipmentsOnPlayer);
                loc1.fashionJewelInfoArr = this.getFashionJewelTooltipsData(GModuleEvent.Mode_Other, arg1, this._curCareer, this._lookUpFashionJewelInfoArr);
                loc1.roleLv = this._curLv;
                loc1.flyLv = this._flyLv;
                return new ToolTipInfo(Tooltip.ToolTipRenderType_Equipment, loc1);
            }
            if (arg1.category == ECategory._ECategoryEquip && arg1.type == EEquip._EEquipHeartLock) 
            {
                return new ToolTipInfo(Tooltip.ToolTipRenderType_Text, Language.getString(30203));
            }
            if (arg1.category == ECategory._ECategoryEquip && (arg1.type == EEquip._EEquipHarmMedalDeeper || arg1.type == EEquip._EEquipHarmMedalLower)) 
            {
                return new ToolTipInfo(Tooltip.ToolTipRenderType_Text, Language.getString(30322));
            }
            return null;
        }

        /* internal  */setToolData(arg1: BaseItem): Array<any>
        {
            if (arg1 == null) 
            {
                return [];
            }
            var loc1=[];
            var loc2=0;
            if (arg1.posIndex != EDressPos._EDressPosFashion) 
            {
                if (arg1.posIndex != EDressPos._EDressPosFashionWeapon) 
                {
                    if (arg1.posIndex != EDressPos._EDressPosWing) 
                    {
                        if (arg1.posIndex != EDressPos._EDressPosFootPrint) 
                        {
                            if (arg1.posIndex != EDressPos._EDressPosBubble) 
                            {
                                if (arg1.posIndex != EDressPos._EDressPosSurround) 
                                {
                                    if (arg1.posIndex != EDressPos._EDressPosWaistBelt) 
                                    {
                                        if (arg1.posIndex == EDressPos._EDressPosElf) 
                                        {
                                            loc2 = WardrobeType.WardrobeElf;
                                        }
                                    }
                                    else 
                                    {
                                        loc2 = WardrobeType.WardrobeWaistBelt;
                                    }
                                }
                                else 
                                {
                                    loc2 = WardrobeType.WardrobeSurroung;
                                }
                            }
                            else 
                            {
                                loc2 = WardrobeType.WardrobeBubble;
                            }
                        }
                        else 
                        {
                            loc2 = WardrobeType.WardrobeFootPrint;
                        }
                    }
                    else 
                    {
                        loc2 = WardrobeType.WardrobeWing;
                    }
                }
                else 
                {
                    loc2 = WardrobeType.WardrobeFashionWeapon;
                }
            }
            else 
            {
                loc2 = WardrobeType.WardrobeFashion;
            }
            loc1 = Cache.instance.wardrobe.getMergeAttributes(loc2);
            return loc1;
        }

        /* internal */ /* var */_mode: string="自己";

        /* internal */ /* var */_curCareer: int;

        /* internal */ /* var */_curLv: int;

        /* internal */ /* var */_flyLv: int;

        /* internal */ /* var */_allEquipmentsOnPlayer: Array<any>;

        /* internal */ /* var */_equipItemTypeFirstArr: Array<any>;

        /* internal */ /* var */_equipItemTypeSecArr: Array<any>;

        /* internal */ /* var */_equipItemFirstArr: Array<any>;

        /* internal */ /* var */_equipItemSecArr: Array<any>;

        /* internal */ /* var */_curPage: int=1;

        /* internal */ /* var */_pageBtn: GLoadedButton;

        /* internal */ /* var */_firstSp: GSprite;

        /* internal */ /* var */_secSp: GSprite;

        /* internal */ /* var */_strengthAddPanel: EquipmentStrengthAddPanel;

        /* internal */ /* var */_lookUpFashionJewelInfoArr: Array<any>;

        /* internal */ /* var */_jewelAddPanel: EquipmentJewelAddPanel;

        /* internal */ /* var */_pageNormalBtn: GButton;
    }
